from utils import mysql_util
base_column = ' id, student_no, class_id, status, create_time, update_time, verify_by '
base_count_column = 'select count(1) from sm_face_res '

def select_by_stu_no(stu_no):
    sql = 'select' + base_column + 'from sm_face_res where student_no = %s'
    res = mysql_util.find_one(sql, (stu_no))
    return res

def insert(args):
    sql = 'insert into sm_face_res(student_no, class_id, status, create_time, update_time, verify_by) ' \
          'values (%s, %s, %s, %s, %s, %s)'
    row = mysql_util.insert(sql, args)
    return row

def update_status_by_stu_no(args):
    sql = 'update sm_face_res set status = %s, update_time = %s where student_no = %s'
    row = mysql_util.update(sql, args)
    return row
